class UserURLFilters {

    def filters = {
        all(controller:'*', action:'*') {
            before = {
            	if(session.user && !session.user.admin){
            		if ( controllerName.equals("note") && !(actionName in ['show','list','index']) ) {
            			log.debug("Acceso denegado a: ${controllerName}/${actionName}")
            			render(view:"/noAccess")
        				return false
            		}
            	}
        		return true
            }
            after = {
                return true
            }
            afterView = {
                return true            
			}
        }
    }
    
}